<template>
  <div class="icons">
    <div v-for="item of iconsList" :key="item.id">
    <div class="icon">
      <div class="icon-img">
        <img
          class="icon-img-content"
          :src="item.iconsImg"
        >
      </div>
      <p class="icon-desc">{{item.iconTitle}}</p>
    </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HomeIcons',
  props: {
    iconsList: Array
  }
}
</script>

<style lang="stylus" scoped>
@import '~style/varibles.styl'
@import '~style/mixins.styl'
.icons
  overflow: hidden
  height: 0
  padding-bottom: 50%
  background: #fff
  .icon
    position: relative
    overflow: hidden
    padding-bottom: 25%
    float: left
    width: 25%
    height: 0
    text-align: center
    .icon-img
      position: absolute
      top: 0
      right: 0
      left: 0
      bottom: 0.44rem
      box-sizing: border-box
      padding: 0.1rem
      .icon-img-content
        height: 100%
        display: block
        margin: 0 auto
    .icon-desc
      position: absolute
      left: 0
      right: 0
      bottom: 0
      height: 0.44rem
      line-height: 0.44rem
      color: $darkTextColor
      elllipsis()
</style>
